var ellogin;
var elsenha;

if (window.addEventListener) 
	window.addEventListener('load',adicionaEventos,false); 
else if (document.addEventListener) 
	document.addEventListener('load',adicionaEventos,false); 
else if (window.attachEvent) 
	window.attachEvent('onload',adicionaEventos); 
else {//Older browsers only 
if (typeof window.onload=='function') { 
	var oldload=window.onload; 
	window.onload=function(){ 
	oldload(); 
	adicionaEventos(); 
	} 
} else 
	window.onload=adicionaEventos; 
}
function adicionaEventos(){
	ellogin = document.getElementById('loginLogin');
	elsenha = document.getElementById('loginPassword');
	if(ellogin != null){
		if(window.addEventListener){
			ellogin.addEventListener('keydown',function(){pressenter()})
			elsenha.addEventListener('keydown',function(){pressenter()})
		}
	}

}
/*
if(document.addEventListener){
	
	ellogin.addEventListener('keypress',function(){pressenter(ellogin)},false)
}else if(window.attachEvent){
	window.attachEvent('onkeypress',function(){pressenter(this)}); 
}
*/
function loga(){
	submitaForm('loginLoginsForm', 'logins', 'logins');
}
function pressenter(){
	if(event.keyCode == 13){
		loga()
	}
	//if()
	
}